package top.gradual.springcloud.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.gradual.springcloud.filter.ErrorFilter;
import top.gradual.springcloud.filter.IpFilter;

/**
 * @Description:
 * @Author: gradual
 * @Date: 2019-06-28 11:04
 */
@Configuration
public class FilterConfig {

    /**
     * @description: 将IpFilter添加进zuul中
     *
     * @date: 2019/6/28 11:04
     * @author: gradual
     *
     * @return: top.gradual.springcloud.filter.IpFilter
     */
    @Bean
    public IpFilter ipFilter() {
        return new IpFilter();
    }


    /**
     * @description: 添加异常处理过滤器
     *
     * @date: 2019/6/28 14:04
     * @author: gradual
     *
     * @return: top.gradual.springcloud.filter.ErrorFilter
     */
    @Bean
    public ErrorFilter errorFilter() {
        return new ErrorFilter();
    }

}
